<?php
$CI =& get_instance();
?>
<h2>Template Product</h2>
<div class="content-inner">
	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">
		<tbody>
		<tr>
			<td>
			<?php $t1=unserialize($ed['t1']);?>
				<table width="100%" border="0" cellpadding="0" cellspacing="0" class="form-table">
				<tbody>
					<tr>
						<td class="label">Name</td>
						<td><input type="text" name="item_name" value="<?=$ed['name']?>" class="input-text"></td>
					</tr>
					<tr>
						<td class="label">Title</td>
						<td><input type="text" name="item_title" class="input-text" value="<?=$ed['title']?>"></td>
					</tr>
					<tr>
						<td class="label">Quantity</td>
						<td>
							<input type="text" name="t1_quantity" class="input-text" value="<?=$t1['quantity']?>" />
						</td>
					</tr>
					<tr>
				    	<td class="label">Group</td>
				    	<td>
							<?php $selected = false;?>
							<select name="t1_gids[]" class="input-text" multiple="true" size="4">
								<option value="">Please select</option>
								<?php foreach($groups as $item):?>
								<?php if(isset($t1['gids'])):?>
							  	<?php $selected = array_search($item['id'], $t1['gids']);?>
							  	<?php endif;?>
							    <option value="<?=$item['id']?>" <?=$selected!==FALSE ? "selected='true'" : "";?>><?=$item['name']?></option>
								<?php endforeach;?>
							</select>
						</td>
				    </tr>
					<tr>
				        <td class="space form">&nbsp;</td>
				        <td class="space">
				          <input type="hidden" name="id" value="<?=$ed['id']?>" />
				          <input type="hidden" name="<?=$act?>" value="1" />
				          <input type="hidden" name="item_temp" value="<?=$template_type?>" />
				          <input type="hidden" name="item_main" value="<?=$nav['id']?>" />
				          <input name="Submit" type="submit" class="ins" value="Save" />
				        </td>
			    	</tr>
				</tbody>
				</table>
			</td>
		</tr>
		</tbody>
	</table>
</div>
